﻿<UserControl x:Class="Sautom.Modules.Proposal.Views.RateManagement"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:res="clr-namespace:Sautom.I18N;assembly=Sautom.I18N" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150*" />
            <ColumnDefinition Width="150*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="250*" />
        </Grid.RowDefinitions>
        <Menu Grid.ColumnSpan="2">
            <!--<MenuItem Header="{Binding Source={x:Static res:ProposalResources.BackToProposals}}" 
                      Command="{Binding BackCommand}" />-->
        </Menu>
        <StackPanel Grid.Row="1">
            <DataGrid IsReadOnly="True" ItemsSource="{Binding RateItems}" Margin="0,0,0,20"
                  SelectionUnit="FullRow" CanUserReorderColumns="False" CanUserResizeColumns="False" 
                  CanUserResizeRows="False" CanUserSortColumns="False" AutoGenerateColumns="False">
                <DataGrid.Columns>
                    <DataGridTextColumn Header="{Binding Source={x:Static res:ProposalResources.StartFromDateLabel}}" 
                                        Binding="{Binding Path=Date, StringFormat=d}" />
                    <DataGridTextColumn Header="{Binding Source={x:Static res:ProposalResources.RateValueLabel}}" 
                                        Binding="{Binding Path=RateValue}" />
                </DataGrid.Columns>
            </DataGrid>
            <Label Content="{Binding Source={x:Static res:ProposalResources.StartFromDateLabel}}" />
            <DatePicker DisplayDateStart="{Binding DisplayStartDate, Mode=OneWay}" SelectedDate="{Binding Date, StringFormat=d, UpdateSourceTrigger=PropertyChanged}" />
            <Label Content="{Binding Source={x:Static res:ProposalResources.RateValueLabel}}" />
            <TextBox Text="{Binding RateValue, UpdateSourceTrigger=PropertyChanged}" />
            <Button Content="{Binding Source={x:Static res:ProposalResources.AddRateBtn}}" Command="{Binding AddRateCommand}" />
        </StackPanel>
    </Grid>
</UserControl>
